/*
Adept MobileRobots Robotics Interface for Applications (ARIA)
Copyright (C) 2004-2005 ActivMedia Robotics LLC
Copyright (C) 2006-2010 MobileRobots Inc.
Copyright (C) 2011-2014 Adept Technology

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

If you wish to redistribute ARIA under different terms, contact 
Adept MobileRobots for information about a commercial version of ARIA at 
robots@mobilerobots.com or 
Adept MobileRobots, 10 Columbia Drive, Amherst, NH 03031; +1-603-881-7960
*/
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.40
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.mobilerobots.Aria;

public class ArKeyHandler {
  /* (begin code from javabody typemap) */

  private long swigCPtr;
  protected boolean swigCMemOwn;

  /* for internal use by swig only */
  public ArKeyHandler(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  /* for internal use by swig only */
  public static long getCPtr(ArKeyHandler obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  /* (end code from javabody typemap) */

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        AriaJavaJNI.delete_ArKeyHandler(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public ArKeyHandler(boolean blocking, boolean addAriaExitCB, SWIGTYPE_p_FILE stream, boolean takeKeysInConstructor) {
    this(AriaJavaJNI.new_ArKeyHandler__SWIG_0(blocking, addAriaExitCB, SWIGTYPE_p_FILE.getCPtr(stream), takeKeysInConstructor), true);
  }

  public ArKeyHandler(boolean blocking, boolean addAriaExitCB, SWIGTYPE_p_FILE stream) {
    this(AriaJavaJNI.new_ArKeyHandler__SWIG_1(blocking, addAriaExitCB, SWIGTYPE_p_FILE.getCPtr(stream)), true);
  }

  public ArKeyHandler(boolean blocking, boolean addAriaExitCB) {
    this(AriaJavaJNI.new_ArKeyHandler__SWIG_2(blocking, addAriaExitCB), true);
  }

  public ArKeyHandler(boolean blocking) {
    this(AriaJavaJNI.new_ArKeyHandler__SWIG_3(blocking), true);
  }

  public ArKeyHandler() {
    this(AriaJavaJNI.new_ArKeyHandler__SWIG_4(), true);
  }

  public boolean addKeyHandler(int keyToHandle, ArFunctor functor) {
    return AriaJavaJNI.ArKeyHandler_addKeyHandler(swigCPtr, this, keyToHandle, ArFunctor.getCPtr(functor), functor);
  }

  public boolean remKeyHandler(int keyToHandler) {
    return AriaJavaJNI.ArKeyHandler_remKeyHandler__SWIG_0(swigCPtr, this, keyToHandler);
  }

  public boolean remKeyHandler(ArFunctor functor) {
    return AriaJavaJNI.ArKeyHandler_remKeyHandler__SWIG_1(swigCPtr, this, ArFunctor.getCPtr(functor), functor);
  }

  public void takeKeys(boolean blocking) {
    AriaJavaJNI.ArKeyHandler_takeKeys__SWIG_0(swigCPtr, this, blocking);
  }

  public void takeKeys() {
    AriaJavaJNI.ArKeyHandler_takeKeys__SWIG_1(swigCPtr, this);
  }

  public void restore() {
    AriaJavaJNI.ArKeyHandler_restore(swigCPtr, this);
  }

  public void checkKeys() {
    AriaJavaJNI.ArKeyHandler_checkKeys(swigCPtr, this);
  }

  public int getKey() {
    return AriaJavaJNI.ArKeyHandler_getKey(swigCPtr, this);
  }

  public final static class KEY {
    public final static KEY UP = new KEY("UP", AriaJavaJNI.ArKeyHandler_UP_get());
    public final static KEY DOWN = new KEY("DOWN");
    public final static KEY LEFT = new KEY("LEFT");
    public final static KEY RIGHT = new KEY("RIGHT");
    public final static KEY ESCAPE = new KEY("ESCAPE");
    public final static KEY SPACE = new KEY("SPACE");
    public final static KEY TAB = new KEY("TAB");
    public final static KEY ENTER = new KEY("ENTER");
    public final static KEY BACKSPACE = new KEY("BACKSPACE");
    public final static KEY _StartFKeys = new KEY("_StartFKeys");
    public final static KEY F1 = new KEY("F1");
    public final static KEY F2 = new KEY("F2");
    public final static KEY F3 = new KEY("F3");
    public final static KEY F4 = new KEY("F4");
    public final static KEY F5 = new KEY("F5");
    public final static KEY F6 = new KEY("F6");
    public final static KEY F7 = new KEY("F7");
    public final static KEY F8 = new KEY("F8");
    public final static KEY F9 = new KEY("F9");
    public final static KEY F10 = new KEY("F10");
    public final static KEY F11 = new KEY("F11");
    public final static KEY F12 = new KEY("F12");
    public final static KEY _EndFKeys = new KEY("_EndFKeys");
    public final static KEY PAGEUP = new KEY("PAGEUP");
    public final static KEY PAGEDOWN = new KEY("PAGEDOWN");
    public final static KEY HOME = new KEY("HOME");
    public final static KEY END = new KEY("END");
    public final static KEY INSERT = new KEY("INSERT");
    public final static KEY DEL = new KEY("DEL");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static KEY swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + KEY.class + " with value " + swigValue);
    }

    private KEY(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private KEY(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private KEY(String swigName, KEY swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static KEY[] swigValues = { UP, DOWN, LEFT, RIGHT, ESCAPE, SPACE, TAB, ENTER, BACKSPACE, _StartFKeys, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, _EndFKeys, PAGEUP, PAGEDOWN, HOME, END, INSERT, DEL };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
